﻿<?php include $this->admin_tpl('meta');?>
<title>店铺列表</title>
<script type="text/javascript" src="<?php echo STATIC_URL;?>plugin/jquery/1.8.2/jquery.min.js"></script>
</head>
<body>
<div class="page-container" style="padding-bottom:0;">
	<form id="search">
		<input type="hidden" value="" name="field">
		<input type="hidden" value="" name="order">
			<div class="c"><span class="select-box inline">
				<select name="status" class="select">
				<option value="">是否启用</option>
				<option value="0">失败</option>
				<option value="1">成功</option>
				</select>
			</div>
			<div class="c"><span class="select-box inline">
				<select name="type" class="select">
				<option value="">选择类型</option>
				<?php
					foreach($log_type as $v){
						echo '<option value="'.$v.'">'.$v.'</option>';
					}
				?>
				</select></span>
			</div>
			<?php include $this->admin_tpl('jst_common/select_shop');?>
			<div class="c">添加时间： <input type="text" class="input-text laydate-icon" style="width:130px;height:30px;" autocomplete="off" id="start" name="start" value="<?php echo $start;?>"></div>
			<div class="c"><input type="text" class="input-text laydate-icon" style="width:130px;height:30px;" autocomplete="off" id="end" name="end" value="<?php echo $end;?>"></div>
		</span>
		<a class="btn btn-success radius" href="javascript:void(0)" id="btn_search"><i class="yzm-iconfont yzm-iconsousuo"></i> 搜索</a>
		<button class="btn btn-primary radius" id="btn_reset" type="reset"><i class="yzm-iconfont yzm-iconshuaxin"></i> 重置</button>
	</form>
	
	<table id="table" class="mt-20" lay-filter="table"></table>
</div>

<script type="text/html" id="tool_temp">
	<a href="javascript:;" onclick="yzm_open('重新获取订单','<?php echo U('reget_order');?>','600','300')" class="btn btn-primary radius"><i class="yzm-iconfont yzm-iconxuanzhuan-1"></i> 重新获取订单</a>
	<a href="javascript:;" onclick="yzm_open('重新获取商品','<?php echo U('reget_item');?>','600','300')" class="btn btn-primary radius"><i class="yzm-iconfont yzm-iconxuanzhuan-1"></i> 重新获取商品</a>
	<a href="javascript:;" id="btn_del" class="btn btn-danger radius"><i class="yzm-iconfont yzm-iconshanchu2"></i> 批量删除</a>
</script>

<?php include $this->admin_tpl('footer');?>
<script type="text/javascript" src="<?php echo STATIC_URL;?>plugin/layui/layui.js"></script>
<script type="text/javascript" src="<?php echo STATIC_URL;?>plugin/laydate/1.1/laydate.js"></script>
<script>
var db = 'jst_log';
layui.use(function(){ //亦可加载特定模块：layui.use(['layer', 'laydate', function(){
	table = layui.table; //表格
	util = layui.util; //工具集
	dropdown = layui.dropdown; //下拉菜单
	form = layui.form;
	//执行一个 table 实例
	option = {
		elem: '#table',
		id:'table',
		height: 'full-80',
		limit:30,
		limits:[30,60,90],
		url:'<?php echo U('jst_log');?>',
		where: $('#search').serializeJson(),
		title: '店铺列表',
		autoSort: false,
		page: {theme:'#409eff',groups:3,hash:true}, //开启分页
		toolbar: '#tool_temp', //开启工具栏，此处显示默认图标，可以自定义模板，详见文档
		cols: [[ //表头
			{type: 'checkbox', fixed: 'left'},
			{field: 'id', title: 'ID', width:80,align:'center',sort:true},
			{field: 'type', title: '类型', width:100,align:'center'},
			{field: 'msg', title: '消息',align:'left'},
			{field: 'has_next', title: '是否分页',width:100,align:'center'},
			{field: 'page_index', title: '当前分页',width:100,align:'center'},
			{field: 'page_count', title: '总共页数',width:100,align:'center'},
			{field: 'shop_name', title: '店铺名称', width:150,align:'center'},
			{field: 'status', title: '是否启用',width:100,align:'center',templet:function(row){
				if(row.status == 1){
					return '<span class="yzm-status-enable"><i class="yzm-iconfont">&#xe81f;</i>成功</span>';
				}else{
					return '<span class="red yzm-status-disable" style="color:#f56c6c;"><i class="yzm-iconfont">&#xe601;</i>失败</span>';
				}
			}},
			{field: 'jst_name', title: '操作聚水潭',width:100,align:'center'},
			{field: 'modified_begin', title: '开始时间',align:'center',width:150,templet: function(row) {if(row.modified_begin){return util.toDateString(row.modified_begin*1000, 'yyyy-MM-dd HH:mm:ss');}else{return '-';}}},
			{field: 'modified_end', title: '结束时间',align:'center',width:150,templet: function(row) {if(row.modified_end){return util.toDateString(row.modified_end*1000, 'yyyy-MM-dd HH:mm:ss');}else{return '-';}}},
			{field: 'add_time', title: '添加时间',align:'center',width:150,templet: function(row) {return util.toDateString(row.add_time*1000, 'yyyy-MM-dd HH:mm:ss');}}
		]],
		done:function(res,curr,count){
			var options = this;
			public_table(db);
			select_table(options,<?php echo json_encode($this->jst_arr);?>,'.dropdown-jst',db,'jst_id');
		}
	};
	table.render(option);
	init_table(db);
})
var start = {elem:'#start',format:'YYYY-MM-DD',min:'1999-01-01',max:'2099-01-01',istoday:false,choose:function(datas){end.min = datas;end.start = datas}
};
var end =   {elem:'#end',  format:'YYYY-MM-DD',min:'1999-01-01',max:'2099-01-01',istoday:false,choose:function(datas){start.max = datas;}};
laydate(start);
laydate(end);
</script>
</body>
</html>